﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Net.Mail;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite esite = new SPSite("http://hetoc/"))
            {
                using (SPWeb eweb = esite.OpenWeb())
                {
                    eweb.DeleteProperty("ea14aee29fe14c92b13e1b48db81c89f_rmdconfig");
                    eweb.Update();
                }

                var jds = esite.WebApplication.JobDefinitions.Where(jd => jd.DisplayName.Contains("BIMP:"));
                foreach (var j in jds)
                    j.Delete();

                return;

                using (MailMessage mail = new MailMessage())
                {
                    mail.From = new MailAddress("asdfgh@troika.ru");
                    mail.To.Add(new MailAddress("oleg_nesterov@troika.ru"));
                    mail.Subject = "test from console app";
                    mail.IsBodyHtml = true;
                    mail.Body = "<xml></xml>";

                    SmtpClient smtp = new SmtpClient("10.20.3.196");//WebApplication.OutboundMailServiceInstance.Server.Address);
                    //SmtpClient smtp = new SmtpClient("10.10.100.29");//WebApplication.OutboundMailServiceInstance.Server.Address);

                    smtp.UseDefaultCredentials = (smtp.Credentials == null);
                    smtp.Send(mail);
                }
            }

        }
    }
}
